package com.phattaradanai.ekardex;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.os.Bundle;

public class About_fragment extends DialogFragment{
	
	static About_fragment newInstance(String title){
		About_fragment fragment = new About_fragment();
		Bundle args = new Bundle();
		args.putString("title", title);
		fragment.setArguments(args);
		return fragment;
	}
	
	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState){
		String title = getArguments().getString("title");
		return new AlertDialog.Builder(getActivity())
			.setIcon(R.drawable.ic_launcher)
			.setTitle(title)
			.setPositiveButton("OK",
					new DialogInterface.OnClickListener() {
						
						@Override
						public void onClick(DialogInterface dialog, int which) {
							// TODO Auto-generated method stub
							((Main_Activity)getActivity()).doPositiveClick();
						}
					}).create();
	}
}